package com.hnn;

import cn.hutool.core.collection.ListUtil;
import com.alibaba.excel.EasyExcel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author hnn
 * @version 1.0
 * @date 2025-06-09 10:54
 */
public class TestExcel {

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class AA{
        private String id;
        private String name;
        private Integer age;
    }

    public static void main(String[] args) {
        List<AA> list = ListUtil.of(new AA("1","张三",18), new AA("2","张三",18));

        EasyExcel.write("D:\\test.xlsx", AA.class)
                .sheet("测试")
                .doWrite(list);
    }
}
